#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int n;
const int N = 10 + 20;

struct plane
{
    int t, d, l;
}p[N];

bool fs[N];

bool dfs(int u, int time)
{
    if (u >= n) 
        return true;
    
    for (int i = 0; i < n; i++)
    {
        if (!fs[i])
        {
            fs[i] = true;
            if (p[i].t + p[i].d < time)
            {
                fs[i] = false;
                return false;
            }
            int t = max(time, p[i].t) + p[i].l;
            if (dfs(u + 1, t))
            {
                return true;
            }
            fs[i] = false;
        }
    }
    return false;
}

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 0; i < n; i++)
        {
            cin >> p[i].t >> p[i].d >> p[i].l;
        }
        if (dfs(0, 0))
        {
            cout << "YES" << endl;
        }
        else cout << "NO" << endl;
        for (int i = 0; i < n; i++)
        {
            fs[i] = false;
        }
    }
    return 0;
}

